#ifndef __LOOT_H__
#define __LOOT_H__

#include "cocos2d.h"
#include "Unit.h"

USING_NS_CC;

class Loot : public CCSprite
{
public:
	Loot();
	~Loot();

	Unit* GetOwner()						{ return m_Onwer; }
	void SetOwner(Unit* _Owner)				{ m_Onwer = _Owner; }
	void IsLootingByPlayer(Player* pPlayer);
	void SetItemEntry(int _Entry)			{ m_ItemEntry = _Entry; }
	void SetCount(int _Count)				{ m_Count = _Count; }
	void SetMovePostion(float x, float y)	{ m_MovePostionX = x; m_MovePostionY = y; }
	void SetBasePostion(float x, float y)	{ m_BasePostionX = x; m_BasePostionY = y; }
	void AddToMap();
	void RemoveFromMap();
	void DesTorySprite();
private:
	float MoveTimer;
	float FallingTimer;
	Unit* m_Onwer;
	Player* Looter;
	int m_ItemEntry;
	int m_Count;
	virtual void update(float diff);
	float m_RemoveTimer;
	float m_MovePostionX;
	float m_MovePostionY;
	float m_BasePostionX;
	float m_BasePostionY;
	float m_SingleMoveX;
	float m_SingleMoveY;
	float m_FallingBasePosY;
	bool IsMoveDone;
};

#endif